Challenges of a type error slicer for the SML language

نویسندگان

  • Vincent Rahli
  • J. B. Wells
  • Fairouz Kamareddine
چکیده

SML (a higher-order function-oriented imperative programming language) depends on automated inference of sophisticated type information. Existing implementations have confusing type error messages. Type error slicing gives the programmer more helpful type error information: (1) It identifies all program points that contribute to a type error rather than blaming just one point. (2) It exhibits a slice of the original program’s syntax instead of showing an internal representation of some program subtree which may have been substantially transformed. (3) It avoids showing internal details of inferred types which were not written by the programmer. A type error slice contains all information needed to understand the error, and avoids irrelevant information. Similar to other previous work for better handling of type errors, type error slicing was initially developed for a very tiny toy language: the formal work was for a core barely larger than the λcalculus, and the implementation had only a few additional primitives. Extending type error slicing to a full programming language is extremely challenging, and to do this for SML we needed a number of innovations. Some issues would be faced for any language, and some are SML-specific but representative of the complexity of language-specific issues likely to be faced by other languages. As an example of a generic issue, the known ways of generating constraints that avoid an explosion in the number of constraints conflict with the need to exclude program parts that are irrelevant to errors, so we developed new ways of handling constraints. As an example of a SML-specific issue, the syntactic class of identifiers in SML depends on earlier declarations, but passing an environment as input makes it more difficult to ensure that error slices cover the right amount of program text, so we developed context sensitive constraints that avoid needing to know identifier syntactic class. Other issues include such things as how to indicate (ir)relevance of various program details, handling also context-sensitive syntax errors, and integration with a program editor. A bonus is that our methods in effect also provide a compositional (bottom up) type inference algorithm for the SML language, which may be useful for reasons other than type error explanation.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A constraint system for a SML type error slicer

Existing compilers for many languages have confusing type error messages. Type error slicing (TES) helps the programmer by isolating the part of a program contributing to a type error, but unfortunately TES was initially done for a tiny toy language. Extending TES to a full programming language is extremely challenging, and for SML we needed a number of innovations and generalisations. Some iss...

متن کامل

Investigations in intersection types: Confluence, and semantics of expansion in the λ-calculus, and a type error slicing method

Type systems were invented in the early 1900s to provide foundations for Mathematics where types were used to avoid paradoxes. Type systems have then been developed and extended throughout the years to serve different purposes such as efficiency or expressiveness. The λ-calculus is used in programming languages, logic, mathematics, and linguistics. Intersection types are a kind of types used fo...

متن کامل

Thesis Proposal: Effective Type Theory for Modularity

The programming language Standard ML (SML) draws much of its expressive power from advanced concepts in type theory. In addition, unlike other HOT (Higher-Order Typed) languages, SML has the distinction of being formally defined. Unfortunately, the Definition of SML is not type-theoretic, making it difficult to analyze and extend. Much work in the last decade has thus been devoted to better und...

متن کامل

EFL Teachers’ Corrective Feedback and Students’ Revision in a Peruvian University: A descriptive study

This study explored the EFL teachers’ written corrective feedback (CF) techniques and their EFL students’ ability to integrate the CF while revising their texts. A total of 72 EFL students and 4 EFL teachers participated in this study. The data were collected through explicitation interviews administered to teachers and students, as well as through students’ written productions. A content analy...

متن کامل

EFL Learners’ Preferences for Error Correction and Its Relationship with Demotivation and Language Proficiency in the Iranian Context

The present study is an attempt to explore any significant relationships between learners’ preferences for error correction, demotivation, and language proficiency (LP). One hundred Iranian EFL students, including both males and females, studying at the departments of foreign languages of Shahid Bahonar University of Kerman and Tehran University took part in this study. In order to obtain the r...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2009